*
* $Id$
*
* $Log: nghevy.F,v $
* Revision 1.1.1.1  2002/06/16 15:18:43  hristov
* Separate distribution  of Geant3
*
* Revision 1.1.1.1  1999/05/18 15:55:21  fca
* AliRoot sources
*
* Revision 1.1.1.1  1995/10/24 10:21:58  cernlib
* Geant
*
*
#include "geant321/pilot.h"
*CMZ :  3.21/02 29/03/94  15.41.48  by  S.Giani
*-- Author :
      SUBROUTINE NGHEVY(D,LD,KZ,AWR,Q,MT)
C       THIS ROUTINE CALCULATES THE EXIT ENERGY AND DIRECTIONAL
C       COSINES FOR THE RECOIL NUCLEUS RESULTING FROM THE (N,G)
C       REACTION MT-102, AND STORES THE RECOIL NUCLEUS IN THE
C       HEAVY ION BANK.  THE ENERGY AND DIRECTIONAL COSINES ARE
C       DETERMINED BY A MOMENTUM BALANCE IN THE LABORATORY SYSTEM
C       WITH THE PHOTONS MOMENTUM EQUAL TO ITS ENERGY.
#include "geant321/minput.inc"
#include "geant321/mconst.inc"
#include "geant321/mnutrn.inc"
#include "geant321/mrecoi.inc"
#include "geant321/mapoll.inc"
#include "geant321/mmass.inc"
#include "geant321/mpstor.inc"
#include "geant321/mgamma.inc"
      DIMENSION D(*),LD(*)
      SAVE
      AR=AWR*AN+AN
C       CALCULATE THE TOTAL MOMENTUM BEFORE THE COLLISION
C       NEUTRON MOMENTUM BEFORE COLLISION (PI) EQUALS TOTAL MOMENTUM
      PI=SQRT(2.0*ZN*EOLD)
C       CALCULATE THE TOTAL MOMEMTUM OF THE EXIT PHOTON
      PO=EG*1.00E+06
C       CALCULATE THE DIRECTIONAL MOMENTUM OF THE RECOIL NUCLEUS
      PRX=PI*UOLD-PO*UG
      PRY=PI*VOLD-PO*VG
      PRZ=PI*WOLD-PO*WG
C       CALCULATE THE TOTAL MOMENTUM OF THE RECOIL NUCLEUS
      PR=SQRT(PRX**2+PRY**2+PRZ**2)
C       CALCULATE THE RECOIL NUCLEUS DIRECTIONAL COSINES
      UR=PRX/PR
      VR=PRY/PR
      WR=PRZ/PR
C       CALCULATE THE RECOIL NUCLEUS EXIT ENERGY
      ER=PR**2/(2*AR*9.31075E+08)
C       CALCULATE AND SET THE CHARGED PARTICLE EXIT PARAMETERS
      XR=X
      YR=Y
      ZR=Z
      WATER=WTBC
      NZR=KZ
      AGER=AGE
      NCOLR=NCOL
      MTNR=MT
      ENIR=EOLD
      UNIR=UOLD
      VNIR=VOLD
      WNIR=WOLD
      ENOR=0.0
      UNOR=0.0
      VNOR=0.0
      WNOR=0.0
      WTNR=0.0
      QR=Q
C       STORE THE RECOIL HEAVY ION IN THE RECOIL BANK
      EP = ER
      UP = UR
      VP = VR
      WP = WR
      AMP = AR
      ZMP = FLOAT(NZR)
      AGEP = AGE
      MTP = MT
      CALL STOPAR(IDHEVY,NHEVY)
      RETURN
      END
